import json

# a = '{"a":"1","b":"2"}'
# b = json.loads(a)
# print(type(b))
# print(b)
#
#
# a = [{"b":"1"}, {"b":"2"}, {"b":"3"}]
# c = set(a)
# print(c)
import os.path

from string import ascii_letters
def reverse_str():
    a = 'DAda89d8aDA9$%dbsfDASDAda$%^&'
    a_list = list(a)
    print(a_list)
    b_list = list()
    c_list = list()
    for i in range(len(a_list)):
        if a_list[i] in ascii_letters:
            b_list.append(a_list[i])
        else:
            c_list.append([i,a_list[i]])
    print('反转前：', b_list)
    # b_list.reverse()
    b_list = b_list[-1::-1]
    print(b_list)
    print(c_list)
    for k in c_list:
        b_list.insert(k[0], k[1])
    print(b_list)
    d = ''.join(b_list)
    print(d)
    print(a)

from pygerrit2 import GerritRestAPI, HTTPBasicAuth
def query_gerrit_comments():
    url = 'http://gerrit.casstime.net:18087'
    auth = HTTPBasicAuth(username='a00519', password='20180701@Work')
    rest = GerritRestAPI(url=url, auth=auth)
    changes = rest.get("/2021-07/omg/omg_icec-cloud-product-spi/data/overview.js",headers={'Content-Type': 'application/json'})
    print(changes.text)

if __name__ == '__main__':
    query_gerrit_comments()